﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO;
using BUS;

namespace FDeal
{
    public partial class WUC_DN_DonDatHang : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] == null)
                    Response.Redirect("~/PH_DoanhNghiep/PHDN_Default.aspx");
                else
                {
                    LoadThongTin();
                }
            }
        }

        public void LoadThongTin()
        {
            string idDN = Request.QueryString["id"].ToString();

            BUS.DonHangBUS dhbus = new DonHangBUS();
            DAO.DONHANG dh = dhbus.ChiTiet(idDN);

            lbl_Id.Text = dh.IDDONHANG;
            lbl_ID2.Text = dh.IDDONHANG;
            lbl_DiaChiNhan.Text = dh.DIACHINHAN;
            lbl_HinhThucThanhToan.Text = dh.HINHTHUCNHANHANG;
            lbl_IDThanhToan.Text = dh.IDTHANHTOAN;
            lbl_QuanHuyen.Text = dh.QUANHUYEN;
            lbl_SoLuong.Text = dh.SOLUONG.ToString();
            lbl_TinhThanh.Text = dh.TINHTHANH;
            lbl_TongGia.Text = dh.TONGGIA.ToString();
        }
    }
}